package com.fdq.bigevent.validation;

import com.fdq.bigevent.anno.State;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class StateValidation implements ConstraintValidator<State,String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        if(s.isEmpty()){
            return false;
        }
        if(s.equals("草稿") || s.equals("已发布")){
            return true;
        }
        return false;
    }
}
